package com.gusto.engine.colfil.service;

import java.util.Collection;
import java.util.List;

import com.gusto.engine.colfil.Distance;
import com.gusto.engine.colfil.Evaluation;
import com.gusto.engine.colfil.Prediction;
import com.gusto.engine.colfil.Rating;

/**
 * <p>Facade for using the collaborative module.</p>
 * 
 * @author amokrane.belloui@gmail.com
 *
 */
public interface CollaborativeService {
	
	public void insertRating(long userId, long itemId, Rating rating, boolean checkExistence);
	public void insertPrediction(long userId, long itemId, Prediction prediction);
	
	public Evaluation getRating(long userId, long itemId);
	public Evaluation getPrediction(long userId, long itemId);
	
	public List<Rating> getItemsRatedByUser(long userId, boolean normalized);
	public List<Rating> getUsersHavingRatedItem(long itemId, boolean normalized);
	
	public double getUserMeanRating(long userId);
	public double getItemMeanRating(long itemId);
	
	public List<Rating> getSubMatrix(Collection<Long> usersIds, Collection<Long> itemsIds);
	
	
	public Distance calculateUserDistance(long user1, long user2);
	public Distance calculateItemDistance(long item1, long item2);
	
}
